package com.dries.portal.module.xxshop.controller;

import com.dries.common.api.CommonResult;
import com.dries.portal.module.xxshop.entity.Feedback;
import com.dries.portal.module.xxshop.service.IFeedbackService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Map;

/**
 * 反馈表
 *
 * @author dries
 * @email samphsanie@gmail.com
 * @date 2020-10-14 14:11:08
 */
@RestController
@RequestMapping("xxshop/feedback")
public class FeedbackController {

    @Resource
    private IFeedbackService feedbackService;

    /**
     * 列表
     */
    @GetMapping("/list")
    public CommonResult list(@RequestParam Map<String, Object> params){

        
        return CommonResult.success();
    }


    /**
     * 信息
     */
    @GetMapping("/info/{feedid}")
    public CommonResult info(@PathVariable("feedid") Long feedid){
		Feedback feedback = feedbackService.getById(feedid);

        return CommonResult.success();
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public CommonResult save(@RequestBody Feedback feedback){
		feedbackService.save(feedback);

        return CommonResult.success();
    }

    /**
     * 修改
     */
    @PutMapping("/update")
    public CommonResult update(@RequestBody Feedback feedback){
		feedbackService.updateById(feedback);

        return CommonResult.success();
    }

    /**
     * 删除
     */
    @DeleteMapping("/delete")
    public CommonResult delete(@RequestBody Long[] feedids){
		feedbackService.removeByIds(Arrays.asList(feedids));

        return CommonResult.success();
    }

}
